package com.zyf.controller;

import com.zyf.client.OrderFeignClient;
import com.zyf.common.result.Result;
import com.zyf.vo.order.OrderCountQueryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/** 订单统计 controller类
 * @author zyf
 * @date 2021年06月05日 13:26
 */
@Api(value = "订单统计")
@RestController
@RequestMapping("/admin/statistics")
public class StatisticsController {

    @Autowired
    private OrderFeignClient orderFeignClient;

    @ApiOperation(value = "获取统计数据")
    @GetMapping("/getCountMap")
    public Result getCountMap(OrderCountQueryVo queryVo){
        Map<String, Object> map = orderFeignClient.selectOrderCount(queryVo);
        return Result.ok(map);
    }
}
